﻿using System.Collections.Generic;
using System.Diagnostics;
using Library.Linq;

namespace Library.Collections.Generic
{
    [DebuggerDisplay("Count={Count}")]
    public sealed class HashSet<T> : ICollection<T>, IEnumerable<T>, ICountable, IIsReadOnly, IDistinct<T>
    {
        public HashSet()
        {

        }
        public HashSet(IEnumerable<T> enumerable)
        {

        }
        public HashSet(IEqualityComparer<T> comparer)
        {
            
        }
        public HashSet(IEnumerable<T> enumerable, IEqualityComparer<T> comparer)
        {

        }
        IEqualityComparer<T> comparer;

        public bool Add(T item)
        {
            throw new System.NotImplementedException();
        }

        public bool Remove(T item)
        {
            throw new System.NotImplementedException();
        }

        public bool Contains(T item)
        {
            throw new System.NotImplementedException();
        }

        public ulong Count
        {
            get
            {
                throw new System.NotImplementedException();
            }
        }

        public bool IsReadOnly
        {
            get { return false; }
        }

        public IEnumerator<T> GetEnumerator()
        {
            throw new System.NotImplementedException();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            throw new System.NotImplementedException();
        }

        bool IDistinct<T>.IsDistinct(out bool value)
        {
            return value = true;
        }

        IEnumerable<T> IDistinct<T>.Distinct()
        {
            return this;
        }

        IEnumerable<T> IDistinct<T>.Distinct(IEqualityComparer<T> comparer)
        {
            if (this.comparer.Equals(comparer)) return this;
            return System.Linq.Enumerable.Distinct(this, comparer);
        }
    }
}
